package learn.contorlller;

import learn.bean.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yxc
 * @date 2021/12/22
 */
@Slf4j
@RestController
public class HelloController {

//    @Autowired
//    Car car;

    @RequestMapping("/hello")
    public String handle01() {
        log.warn("111");
        return "Hello, Spring Boot 2!";
    }


//    @RequestMapping("/car")
//    public String getMyCar(){
//        return car.toString();
//    }

    @Autowired
    private Person person;

    @RequestMapping("/helloPerson")
    public String helloPerson() {
        System.out.println(person.getUsername());
        return person.toString();
    }

    @RequestMapping("logo2.ico")
    public String helloWeb() {
        return "aaa";
    }
}
